/**
 * 
 */
package com.alphasystem.commerce.model.config;

import static javax.persistence.FetchType.EAGER;
import static javax.persistence.InheritanceType.JOINED;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CollectionTable;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.JoinColumn;
import javax.persistence.OrderColumn;
import javax.persistence.Table;

/**
 * @author sali
 * 
 */
@Entity
@Table(name = "LIST_CONFIG")
@Inheritance(strategy = JOINED)
public class ListConfiguration extends AbstractConfiguration {

	private static final long serialVersionUID = 529055111099442186L;

	protected List<String> values;

	public ListConfiguration() {
		this(TEMP_ID);
	}

	public ListConfiguration(String id) {
		super(id);
		values = new ArrayList<String>();
	}

	/**
	 * @return the values
	 */
	@ElementCollection(fetch = EAGER)
	@CollectionTable(name = "LIST_CONFIG_VALUES", joinColumns = @JoinColumn(name = "CONFIG_ID"))
	@OrderColumn(name = "SEQUENCE")
	@Column(name = "VALUE")
	public List<String> getValues() {
		return values;
	}

	/**
	 * @param values
	 *            the values to set
	 */
	public void setValues(List<String> values) {
		this.values = values;
	}

}
